{layout name="admin:layout" /}
<div class="tipbox tipbox-message">
    <span class="fn-fb">友情提示:</span>
    <p class="gray">
        1、打开远程附件后,除用户上传的证书文件外,所有资源都会储存对应的云储存上。</a><br /> 
        2、切换储存方式后,原填入的数据会被重置。</a><br /> 
    </p>
</div>
<form id="form" action="{url('sysyte/admin.setting/aliOss')}">
    <table class="formtable">
        <tr>
            <th>储存方式:</th>
            <td>
                <input class="radio upload_driver" type="radio" name="upload_driver" value="local" datatype="*" {if $info.upload_driver == 'local' || empty($info.upload_driver)}checked{/if}/> 本地附件
                <input class="radio upload_driver" type="radio" name="upload_driver" value="oss" {if $info.upload_driver == 'oss'}checked{/if} /> 阿里云OSS
            </td>
        </tr>
        <tr>
            <th>文件类型:</th>
            <td>
                <input class="input w500" datatype="*" type="text" name="upload_exts" value="{$info.upload_exts?$info.upload_exts:''}" />
                <p class="gray">以逗号分开。例如jpeg,jpg,gif,bmp,png,doc,xls,mp4,m4a,mp3,aac)</p>
            </td>
        </tr>
        <tr>
            <th>附件域名:</th>
            <td>
                <input class="input w500" datatype="httplink" type="text" name="domain" value="{$info.domain?$info.domain:''}" />
                <p class="gray">必须以https://和http://开始,以 / 结尾</p>
            </td>
        </tr>
    </table>
    <table class="formtable oss {if $info.upload_driver == 'local' || empty($info.upload_driver)}fn-hide{/if}">
        <tr>
            <th>access_id:</th>
            <td><input class="input w300" type="text" name="access_id" value="{$info.access_id?$info.access_id:''}"/></td>
        </tr>
        <tr>
            <th>secret_key:</th>
            <td><input class="input w300" type="text" name="secret_key" value="{$info.secret_key?$info.secret_key:''}"/></td>
        </tr>
        <tr>
            <th>bucket:</th>
            <td><input class="input w300" type="text" name="bucket" value="{$info.bucket?$info.bucket:''}"/></td>
        </tr>
        <tr>
            <th>区域城市/city:</th>
            <td><input class="input w200" type="text" name="city" value="{$info.city?$info.city:''}"/></td>
        </tr>
        <tr>
            <th>内网传输:</th>
            <td>
                <input class="radio" type="radio" name="is_internal" value="0" {if !$info.is_internal }checked{/if}/> 外网
                <input class="radio" type="radio" name="is_internal" value="1" {if $info.is_internal}checked{/if}/> 内网
                <span class="gray">服务器和对象储存都在阿里云和同一个城市,建议开启。</span>
            </td>
        </tr>
    </table>
    <table class="formtable">
        <tr>
            <th></th>
            <td>
                <input type="submit" value="确定" class="button submit" />
                <input type="reset" value="重置" class="button button-blank" />
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
    Do('base', 'layer', 'form', function () {
        $('#form').isForm();
        $('.upload_driver').change(function(){
            $(this).val() == 'oss'?$('.oss').show():$('.oss').hide();
        });
    })
</script>